#!/usr/bin/env python
# _*_ coding:utf-8 _*_

# 记得文件属性要允许作为程序执行文件 #
 
PACKAGE = "robot_sim"      # 这个就是你的include文件的文件夹名字
 
from dynamic_reconfigure.parameter_generator_catkin import *
 
gen = ParameterGenerator()

# 动态参数名字 数据类型 掩码一般为0 说明与描述 参数设置的默认值 可设置的最小值 可设置的最大值 #
gen.add("obj_name",    str_t,    0, "obj_name", "box")
gen.add("obj_x",    double_t, 0, "obj_x", -0.25, -0.75, 0.25)
gen.add("obj_y",    double_t, 0, "obj_y", 0.75, 0.25, 1.25)
gen.add("obj_z",    double_t, 0, "obj_z", 0.98, 0, 1.5)
gen.add("obj_roll",    double_t, 0, "obj_roll", 0, -180.0, 180)
gen.add("obj_pitch",    double_t, 0, "obj_pitch", 0, -180.0, 180)
gen.add("obj_yaw",    double_t, 0, "obj_yaw", 0, -180.0, 180)

gen.add("eelink_x",    double_t, 0, "eelink_x", -0.11, -0.75, 0.75)
gen.add("eelink_y",    double_t, 0, "eelink_y", 0.67, 0.0, 1.5)
gen.add("eelink_z",    double_t, 0, "eelink_z", 1.1, 1.00, 1.7)
gen.add("eelink_roll",    double_t, 0, "eelink_roll", 0, -180.0, 180)
gen.add("eelink_pitch",    double_t, 0, "eelink_pitch", 0, -180.0, 180)
gen.add("eelink_yaw",    double_t, 0, "eelink_yaw", 0, -180.0, 180)

gen.add("grasp_angle",    double_t, 0, "grasp_angle", 0.8, 0.0, 0.8)

gen.add("enable_move_and_grasp_flag",    bool_t,   0, "whether move and grasp or not", False )
gen.add("enable_move_obj_flag",    bool_t,   0, "whether move obj or not", False )
gen.add("reset_obj_pos_flag",    bool_t,   0, "rest obj pos or not", False )
gen.add("enable_moveit_flag",    bool_t,   0, "whether move ur5 or not", False )
gen.add("enable_grasp_flag",    bool_t,   0, "whether grasp or not", False )
gen.add("save_image_flag",    bool_t,   0, "whether save_image_flag or not", False )
gen.add("save_mask_flag",    bool_t,   0, "whether save_mask_flag or not", False )


# gen.add("cmd_pub_rate", int_t,    0, "turtlesim cmd pub rate", 1, 0, 5)
 
# log_enum = gen.enum([ gen.const("info", int_t, 0, "log print flag:INFO"),
#                       gen.const("warn", int_t, 1, "log print flag:WARN"),
#                       gen.const("error", int_t, 2, "log print flag:ERROR")],
#                       "Set Log Level")
# gen.add("log_level", int_t, 0, "Set Log Level", 0, 0, 2, edit_method=log_enum)

# 第二个参数为运行的节点名 第三个参数是生成的文件名字与.cfg文件名字一样 #
exit(gen.generate(PACKAGE, "geometric_method_grasp", "grasp"))    # 用于生成graspConfig.h在cpp中可以使用